//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { AdminApplet, AdminAppletResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooAdminAppletList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<AdminAppletResponse>(`/uctoo/admin_applet/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooAdminApplet = async (id: string) => {
  return requestClient.get<AdminApplet>(`/uctoo/admin_applet/${id}`);
};

export const adductooAdminApplet = async (data: Partial<AdminApplet>) => {
  return requestClient.post<AdminApplet>('/uctoo/admin_applet/add', data);
};

export const edituctooAdminApplet = async (data: Partial<AdminApplet>) => {
  return requestClient.post<AdminApplet>('/uctoo/admin_applet/edit', data);
};

export const deleteuctooAdminApplet = async (id: string) => {
  return requestClient.post<any>('/uctoo/admin_applet/del', { id });
};
